<?php echo $this->render("header.phtml");?>
<link href="<?=$this->styleurl?>/css/book.css" rel="stylesheet" type="text/css" />
<div id="main2" style="padding-left:2px; padding-right:2px;">

<div class="content chief-bg">
<div class="ct-lose">
<div class="news_comments">
     <div class="comments_ct">
          <div class="middle">
          <p class="comment_note">
          <a href="#re">访客留言</a>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <a href="javascript:void(null)" onclick="document.getElementById('mes_writer').focus();">我要留言</a>
          </p>
	<?php 
		$j = 1;
		$p = isset($_GET["p"]) ? $_GET["p"] : 1;
		$p < 0 && $p ==1;
	    foreach ($this->paginator as $row):
	?>  
	       <div class="comment">
               <div class="midd">
               <p class="title"><span class="user"><span class="name"><?php echo $row["mes_writer"]; ?></span><span class="text">在(<?php echo date('Y-m-d H:i:s',$row["mes_date"]); ?>)留言
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;留言IP：<a href="http://www.ip138.com/ips.asp?ip=<?php echo $row["mes_ip"]; ?>&action=2" target="_blank"><?php echo $row["mes_ip"]; ?></a></span></span><span class="level"><?php echo 10*($p-1)+$j;$j++;; ?></span></p>
               <p class="note">
               <?php echo $row["mes_content"]; ?>
               </p>
			  </div>
           <div class="bottom">
           </div>
        </div>
	<?php 
	endforeach;
	 ?>

<div id="pages" style="padding-right:50px;">留言总数：<b><?php echo $this->total_mes; ?></b>篇
 <?=$this->paginationControl($this->paginator, 'Elastic', 'pagestyle.phtml'); ?>
</div>
<div class="replay">
<table border="0" cellpadding="0" style="border-style:solid; border-width:1px; padding:1px; border-collapse: collapse" bordercolor="#CCCCCC" width="850" height="184">
<tr><td>&nbsp;</td></tr>
<form action="<?=$this->baseUrl?>/message/addmes" method="POST" style="margin:0px; padding:0px;">
<tr>
<td width="96" height="20">
  <div align="right" style="font-size:12px">用户名：</div></td>
<td height="20"><input type="text" id="mes_writer" name="mes_writer" size="16" maxlength="50" />
&nbsp;&nbsp;
  <input disabled  readonly="readonly"   type="text"   name="remLen"   size="4"   maxlength="3"   value="100" />个字符</td>
</tr>
<tr>
<td width="96" height="40">
  <div align="right" style="font-size:12px">验证码：</div></td>
<td height="30">
<input type="text" name="verify" size="12" style="height:25px" value="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img onclick="change_verify()" id="verify_img" src="/verify?r=<?php echo rand(0,10000);?>" height="30" width="90" style="vertical-align: middle;">
</td>
</tr>
<tr>
<td width="96" height="71"><SCRIPT   LANGUAGE="JavaScript">   
  <!--//   
  function   textCounter(field,   countfield,   maxlimit)   {   
  //   定义函数，传入3个参数，分别为表单区的名字，表单域元素名，字符限制；   
  if   (field.value.length   >   maxlimit)     
  //如果元素区字符数大于最大字符数，按照最大字符数截断；     
  field.value   =   field.value.substring(0,   maxlimit);   
  else   
  //在记数区文本框内显示剩余的字符数；     
  countfield.value   =   maxlimit   -   field.value.length;   
  }
  function change_verify(){
  	var img = document.getElementById("verify_img");
	img.src = "/verify?r="+ Math.random();
  } 
  //-->   
  </SCRIPT>  
    
 <div align="right" style="font-size:12px">留言内容：</div></td>
<td height="71"><textarea rows="4" name="mes_content" cols="50" onKeyDown="textCounter(this.form.mes_content,this.form.remLen,100);"   onKeyUp="textCounter(this.form.mes_content,this.form.remLen,100);"></textarea>
</tr>
<tr>
<td height="30" colspan="2">
  <div align="center">
    <input type="submit" value="留言" name="hf">
    <input name="action" type="hidden" id="action" value="add">
  </div></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">

<tr><td width="100%" height="1" colspan="4"></td></tr>
</table>      	</td>
</tr>
</form>
</table>
      </div>

</div>


   </div>
</div>
</div>
</div>

</div>

<?php echo $this->render('foot.phtml'); ?>
</body> 
</html> 